<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="language" content="en" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<link rel="stylesheet" type="text/css" href="css/api.css" />
<script type="text/javascript" src="js/jquery.js"></script>
<title>CButtonColumn</title>
</head>

<body>
<div id="apiPage">

<div id="apiHeader">
<a href="http://www.yiiframework.com">Yii Framework</a> v1.1.12 Class Reference
</div><!-- end of header -->

<div id="content">
<h1>CButtonColumn</h1>
<div id="nav">
<a href="index.html">All Packages</a>
| <a href="#properties">Properties</a>
| <a href="#methods">Methods</a>
</div>

<table class="summaryTable docClass">
<colgroup>
	<col class="col-name" />
	<col class="col-value" />
</colgroup>
<tr>
  <th>Package</th>
  <td><a href="index.html#zii.widgets.grid">zii.widgets.grid</a></td>
</tr>
<tr>
  <th>Inheritance</th>
  <td>class CButtonColumn &raquo;
<a href="CGridColumn.html">CGridColumn</a> &raquo;
<a href="CComponent.html">CComponent</a></td>
</tr>
<tr>
  <th>Since</th>
  <td>1.1</td>
</tr>
<tr>
  <th>Version</th>
  <td>$Id$</td>
</tr>
<tr>
  <th>Source Code</th>
  <td><a class="sourceLink" href="https://github.com/yiisoft/yii/blob/1.1.12/framework/zii/widgets/grid/CButtonColumn.php">framework/zii/widgets/grid/CButtonColumn.php</a></td>
</tr>
</table>

<div id="classDescription">
CButtonColumn represents a grid view column that renders one or several buttons.
<br/><br/>
By default, it will display three buttons, "view", "update" and "delete", which triggers the corresponding
actions on the model of the row.
<br/><br/>
By configuring <a href="CButtonColumn.html#buttons">buttons</a> and <a href="CButtonColumn.html#template">template</a> properties, the column can display other buttons
and customize the display order of the buttons.</div>
<a name="properties"></a>

<div class="summary docProperty">
<h2>Public Properties</h2>

<p><a href="#" class="toggle">Hide inherited properties</a></p>

<table class="summaryTable">
<colgroup>
	<col class="col-property" />
	<col class="col-type" />
	<col class="col-description" />
	<col class="col-defined" />
</colgroup>
<tr>
  <th>Property</th><th>Type</th><th>Description</th><th>Defined By</th>
</tr>
<tr id="afterDelete">
  <td><a href="CButtonColumn.html#afterDelete-detail">afterDelete</a></td>
  <td>string</td>
  <td>a javascript function that will be invoked after the delete ajax call.</td>
  <td>CButtonColumn</td>
</tr>
<tr id="buttons">
  <td><a href="CButtonColumn.html#buttons-detail">buttons</a></td>
  <td>array</td>
  <td>the configuration for additional buttons.</td>
  <td>CButtonColumn</td>
</tr>
<tr class="inherited" id="cssClassExpression">
  <td><a href="CGridColumn.html#cssClassExpression-detail">cssClassExpression</a></td>
  <td>string</td>
  <td>a PHP expression that is evaluated for every data cell and whose result
is used as the CSS class name for the data cell.</td>
  <td><a href="CGridColumn.html">CGridColumn</a></td>
</tr>
<tr id="deleteButtonImageUrl">
  <td><a href="CButtonColumn.html#deleteButtonImageUrl-detail">deleteButtonImageUrl</a></td>
  <td>string</td>
  <td>the image URL for the delete button.</td>
  <td>CButtonColumn</td>
</tr>
<tr id="deleteButtonLabel">
  <td><a href="CButtonColumn.html#deleteButtonLabel-detail">deleteButtonLabel</a></td>
  <td>string</td>
  <td>the label for the delete button.</td>
  <td>CButtonColumn</td>
</tr>
<tr id="deleteButtonOptions">
  <td><a href="CButtonColumn.html#deleteButtonOptions-detail">deleteButtonOptions</a></td>
  <td>array</td>
  <td>the HTML options for the view button tag.</td>
  <td>CButtonColumn</td>
</tr>
<tr id="deleteButtonUrl">
  <td><a href="CButtonColumn.html#deleteButtonUrl-detail">deleteButtonUrl</a></td>
  <td>string</td>
  <td>a PHP expression that is evaluated for every delete button and whose result is used
as the URL for the delete button.</td>
  <td>CButtonColumn</td>
</tr>
<tr id="deleteConfirmation">
  <td><a href="CButtonColumn.html#deleteConfirmation-detail">deleteConfirmation</a></td>
  <td>string</td>
  <td>the confirmation message to be displayed when delete button is clicked.</td>
  <td>CButtonColumn</td>
</tr>
<tr class="inherited" id="filterHtmlOptions">
  <td><a href="CGridColumn.html#filterHtmlOptions-detail">filterHtmlOptions</a></td>
  <td>array</td>
  <td>the HTML options for the filter cell tag.</td>
  <td><a href="CGridColumn.html">CGridColumn</a></td>
</tr>
<tr class="inherited" id="footer">
  <td><a href="CGridColumn.html#footer-detail">footer</a></td>
  <td>string</td>
  <td>the footer cell text.</td>
  <td><a href="CGridColumn.html">CGridColumn</a></td>
</tr>
<tr id="footerHtmlOptions">
  <td><a href="CButtonColumn.html#footerHtmlOptions-detail">footerHtmlOptions</a></td>
  <td>array</td>
  <td>the HTML options for the footer cell tag.</td>
  <td>CButtonColumn</td>
</tr>
<tr class="inherited" id="grid">
  <td><a href="CGridColumn.html#grid-detail">grid</a></td>
  <td><a href="CGridView.html">CGridView</a></td>
  <td>the grid view object that owns this column.</td>
  <td><a href="CGridColumn.html">CGridColumn</a></td>
</tr>
<tr class="inherited" id="hasFooter">
  <td><a href="CGridColumn.html#hasFooter-detail">hasFooter</a></td>
  <td>boolean</td>
  <td>whether this column has a footer cell.</td>
  <td><a href="CGridColumn.html">CGridColumn</a></td>
</tr>
<tr class="inherited" id="header">
  <td><a href="CGridColumn.html#header-detail">header</a></td>
  <td>string</td>
  <td>the header cell text.</td>
  <td><a href="CGridColumn.html">CGridColumn</a></td>
</tr>
<tr id="headerHtmlOptions">
  <td><a href="CButtonColumn.html#headerHtmlOptions-detail">headerHtmlOptions</a></td>
  <td>array</td>
  <td>the HTML options for the header cell tag.</td>
  <td>CButtonColumn</td>
</tr>
<tr id="htmlOptions">
  <td><a href="CButtonColumn.html#htmlOptions-detail">htmlOptions</a></td>
  <td>array</td>
  <td>the HTML options for the data cell tags.</td>
  <td>CButtonColumn</td>
</tr>
<tr class="inherited" id="id">
  <td><a href="CGridColumn.html#id-detail">id</a></td>
  <td>string</td>
  <td>the ID of this column.</td>
  <td><a href="CGridColumn.html">CGridColumn</a></td>
</tr>
<tr id="template">
  <td><a href="CButtonColumn.html#template-detail">template</a></td>
  <td>string</td>
  <td>the template that is used to render the content in each data cell.</td>
  <td>CButtonColumn</td>
</tr>
<tr id="updateButtonImageUrl">
  <td><a href="CButtonColumn.html#updateButtonImageUrl-detail">updateButtonImageUrl</a></td>
  <td>string</td>
  <td>the image URL for the update button.</td>
  <td>CButtonColumn</td>
</tr>
<tr id="updateButtonLabel">
  <td><a href="CButtonColumn.html#updateButtonLabel-detail">updateButtonLabel</a></td>
  <td>string</td>
  <td>the label for the update button.</td>
  <td>CButtonColumn</td>
</tr>
<tr id="updateButtonOptions">
  <td><a href="CButtonColumn.html#updateButtonOptions-detail">updateButtonOptions</a></td>
  <td>array</td>
  <td>the HTML options for the update button tag.</td>
  <td>CButtonColumn</td>
</tr>
<tr id="updateButtonUrl">
  <td><a href="CButtonColumn.html#updateButtonUrl-detail">updateButtonUrl</a></td>
  <td>string</td>
  <td>a PHP expression that is evaluated for every update button and whose result is used
as the URL for the update button.</td>
  <td>CButtonColumn</td>
</tr>
<tr id="viewButtonImageUrl">
  <td><a href="CButtonColumn.html#viewButtonImageUrl-detail">viewButtonImageUrl</a></td>
  <td>string</td>
  <td>the image URL for the view button.</td>
  <td>CButtonColumn</td>
</tr>
<tr id="viewButtonLabel">
  <td><a href="CButtonColumn.html#viewButtonLabel-detail">viewButtonLabel</a></td>
  <td>string</td>
  <td>the label for the view button.</td>
  <td>CButtonColumn</td>
</tr>
<tr id="viewButtonOptions">
  <td><a href="CButtonColumn.html#viewButtonOptions-detail">viewButtonOptions</a></td>
  <td>array</td>
  <td>the HTML options for the view button tag.</td>
  <td>CButtonColumn</td>
</tr>
<tr id="viewButtonUrl">
  <td><a href="CButtonColumn.html#viewButtonUrl-detail">viewButtonUrl</a></td>
  <td>string</td>
  <td>a PHP expression that is evaluated for every view button and whose result is used
as the URL for the view button.</td>
  <td>CButtonColumn</td>
</tr>
<tr class="inherited" id="visible">
  <td><a href="CGridColumn.html#visible-detail">visible</a></td>
  <td>boolean</td>
  <td>whether this column is visible.</td>
  <td><a href="CGridColumn.html">CGridColumn</a></td>
</tr>
</table>
</div>
<a name="methods"></a>

<div class="summary docMethod">
<h2>Public Methods</h2>

<p><a href="#" class="toggle">Hide inherited methods</a></p>

<table class="summaryTable">
<colgroup>
	<col class="col-method" />
	<col class="col-description" />
	<col class="col-defined" />
</colgroup>
<tr>
  <th>Method</th><th>Description</th><th>Defined By</th>
</tr>
<tr class="inherited" id="__call">
  <td><a href="CComponent.html#__call-detail">__call()</a></td>
  <td>Calls the named method which is not a class method.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="__construct">
  <td><a href="CGridColumn.html#__construct-detail">__construct()</a></td>
  <td>Constructor.</td>
  <td><a href="CGridColumn.html">CGridColumn</a></td>
</tr>
<tr class="inherited" id="__get">
  <td><a href="CComponent.html#__get-detail">__get()</a></td>
  <td>Returns a property value, an event handler list or a behavior based on its name.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="__isset">
  <td><a href="CComponent.html#__isset-detail">__isset()</a></td>
  <td>Checks if a property value is null.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="__set">
  <td><a href="CComponent.html#__set-detail">__set()</a></td>
  <td>Sets value of a component property.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="__unset">
  <td><a href="CComponent.html#__unset-detail">__unset()</a></td>
  <td>Sets a component property to be null.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="asa">
  <td><a href="CComponent.html#asa-detail">asa()</a></td>
  <td>Returns the named behavior object.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="attachBehavior">
  <td><a href="CComponent.html#attachBehavior-detail">attachBehavior()</a></td>
  <td>Attaches a behavior to this component.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="attachBehaviors">
  <td><a href="CComponent.html#attachBehaviors-detail">attachBehaviors()</a></td>
  <td>Attaches a list of behaviors to the component.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="attachEventHandler">
  <td><a href="CComponent.html#attachEventHandler-detail">attachEventHandler()</a></td>
  <td>Attaches an event handler to an event.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="canGetProperty">
  <td><a href="CComponent.html#canGetProperty-detail">canGetProperty()</a></td>
  <td>Determines whether a property can be read.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="canSetProperty">
  <td><a href="CComponent.html#canSetProperty-detail">canSetProperty()</a></td>
  <td>Determines whether a property can be set.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="detachBehavior">
  <td><a href="CComponent.html#detachBehavior-detail">detachBehavior()</a></td>
  <td>Detaches a behavior from the component.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="detachBehaviors">
  <td><a href="CComponent.html#detachBehaviors-detail">detachBehaviors()</a></td>
  <td>Detaches all behaviors from the component.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="detachEventHandler">
  <td><a href="CComponent.html#detachEventHandler-detail">detachEventHandler()</a></td>
  <td>Detaches an existing event handler.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="disableBehavior">
  <td><a href="CComponent.html#disableBehavior-detail">disableBehavior()</a></td>
  <td>Disables an attached behavior.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="disableBehaviors">
  <td><a href="CComponent.html#disableBehaviors-detail">disableBehaviors()</a></td>
  <td>Disables all behaviors attached to this component.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="enableBehavior">
  <td><a href="CComponent.html#enableBehavior-detail">enableBehavior()</a></td>
  <td>Enables an attached behavior.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="enableBehaviors">
  <td><a href="CComponent.html#enableBehaviors-detail">enableBehaviors()</a></td>
  <td>Enables all behaviors attached to this component.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="evaluateExpression">
  <td><a href="CComponent.html#evaluateExpression-detail">evaluateExpression()</a></td>
  <td>Evaluates a PHP expression or callback under the context of this component.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="getEventHandlers">
  <td><a href="CComponent.html#getEventHandlers-detail">getEventHandlers()</a></td>
  <td>Returns the list of attached event handlers for an event.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="getHasFooter">
  <td><a href="CGridColumn.html#getHasFooter-detail">getHasFooter()</a></td>
  <td>Returns whether this column has a footer cell.
This is determined based on whether <a href="CButtonColumn.html#footer">footer</a> is set.</td>
  <td><a href="CGridColumn.html">CGridColumn</a></td>
</tr>
<tr class="inherited" id="hasEvent">
  <td><a href="CComponent.html#hasEvent-detail">hasEvent()</a></td>
  <td>Determines whether an event is defined.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="hasEventHandler">
  <td><a href="CComponent.html#hasEventHandler-detail">hasEventHandler()</a></td>
  <td>Checks whether the named event has attached handlers.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="hasProperty">
  <td><a href="CComponent.html#hasProperty-detail">hasProperty()</a></td>
  <td>Determines whether a property is defined.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr id="init">
  <td><a href="CButtonColumn.html#init-detail">init()</a></td>
  <td>Initializes the column.</td>
  <td>CButtonColumn</td>
</tr>
<tr class="inherited" id="raiseEvent">
  <td><a href="CComponent.html#raiseEvent-detail">raiseEvent()</a></td>
  <td>Raises an event.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="renderDataCell">
  <td><a href="CGridColumn.html#renderDataCell-detail">renderDataCell()</a></td>
  <td>Renders a data cell.</td>
  <td><a href="CGridColumn.html">CGridColumn</a></td>
</tr>
<tr class="inherited" id="renderFilterCell">
  <td><a href="CGridColumn.html#renderFilterCell-detail">renderFilterCell()</a></td>
  <td>Renders the filter cell.</td>
  <td><a href="CGridColumn.html">CGridColumn</a></td>
</tr>
<tr class="inherited" id="renderFooterCell">
  <td><a href="CGridColumn.html#renderFooterCell-detail">renderFooterCell()</a></td>
  <td>Renders the footer cell.</td>
  <td><a href="CGridColumn.html">CGridColumn</a></td>
</tr>
<tr class="inherited" id="renderHeaderCell">
  <td><a href="CGridColumn.html#renderHeaderCell-detail">renderHeaderCell()</a></td>
  <td>Renders the header cell.</td>
  <td><a href="CGridColumn.html">CGridColumn</a></td>
</tr>
</table>
</div>
<div class="summary docMethod">
<h2>Protected Methods</h2>

<p><a href="#" class="toggle">Hide inherited methods</a></p>

<table class="summaryTable">
<colgroup>
	<col class="col-method" />
	<col class="col-description" />
	<col class="col-defined" />
</colgroup>
<tr>
  <th>Method</th><th>Description</th><th>Defined By</th>
</tr>
<tr id="initDefaultButtons">
  <td><a href="CButtonColumn.html#initDefaultButtons-detail">initDefaultButtons()</a></td>
  <td>Initializes the default buttons (view, update and delete).</td>
  <td>CButtonColumn</td>
</tr>
<tr id="registerClientScript">
  <td><a href="CButtonColumn.html#registerClientScript-detail">registerClientScript()</a></td>
  <td>Registers the client scripts for the button column.</td>
  <td>CButtonColumn</td>
</tr>
<tr id="renderButton">
  <td><a href="CButtonColumn.html#renderButton-detail">renderButton()</a></td>
  <td>Renders a link button.</td>
  <td>CButtonColumn</td>
</tr>
<tr id="renderDataCellContent">
  <td><a href="CButtonColumn.html#renderDataCellContent-detail">renderDataCellContent()</a></td>
  <td>Renders the data cell content.</td>
  <td>CButtonColumn</td>
</tr>
<tr class="inherited" id="renderFilterCellContent">
  <td><a href="CGridColumn.html#renderFilterCellContent-detail">renderFilterCellContent()</a></td>
  <td>Renders the filter cell content.</td>
  <td><a href="CGridColumn.html">CGridColumn</a></td>
</tr>
<tr class="inherited" id="renderFooterCellContent">
  <td><a href="CGridColumn.html#renderFooterCellContent-detail">renderFooterCellContent()</a></td>
  <td>Renders the footer cell content.</td>
  <td><a href="CGridColumn.html">CGridColumn</a></td>
</tr>
<tr class="inherited" id="renderHeaderCellContent">
  <td><a href="CGridColumn.html#renderHeaderCellContent-detail">renderHeaderCellContent()</a></td>
  <td>Renders the header cell content.</td>
  <td><a href="CGridColumn.html">CGridColumn</a></td>
</tr>
</table>
</div>
<a name="events"></a>

<h2>Property Details</h2>
<div class="detailHeader" id="afterDelete-detail">
afterDelete<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public string <b>$afterDelete</b>;</div>

<p>a javascript function that will be invoked after the delete ajax call.
This property is used only if <code>$this->buttons['delete']['click']</code> is not set.
<br/><br/>
The function signature is <code>function(link, success, data)</code>
<ul>
<li><code>link</code> references the delete link.</li>
<li><code>success</code> status of the ajax call, true if the ajax call was successful, false if the ajax call failed.
<li><code>data</code> the data returned by the server in case of a successful call or XHR object in case of error.
</ul>
Note that if success is true it does not mean that the delete was successful, it only means that the ajax call was successful.
<br/><br/>
Example:
<pre>
 array(
    class'=&gt;'CButtonColumn',
    'afterDelete'=&gt;'function(link,success,data){ if(success) alert(&quot;Delete completed successfuly&quot;); }',
 ),
</pre></p>


<div class="detailHeader" id="buttons-detail">
buttons<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public array <b>$buttons</b>;</div>

<p>the configuration for additional buttons. Each array element specifies a single button
which has the following format:
<pre>
'buttonID' =&gt; array(
    'label'=&gt;'...',     // text label of the button
    'url'=&gt;'...',       // a PHP expression for generating the URL of the button
    'imageUrl'=&gt;'...',  // image URL of the button. If not set or false, a text link is used
    'options'=&gt;array(...), // HTML options for the button tag
    'click'=&gt;'...',     // a JS function to be invoked when the button is clicked
    'visible'=&gt;'...',   // a PHP expression for determining whether the button is visible
)
</pre>
In the PHP expression for the 'url' option and/or 'visible' option, the variable <code>$row</code>
refers to the current row number (zero-based), and <code>$data</code> refers to the data model for
the row.
<br/><br/>
Note that in order to display these additional buttons, the <a href="CButtonColumn.html#template">template</a> property needs to
be configured so that the corresponding button IDs appear as tokens in the template.</p>


<div class="detailHeader" id="deleteButtonImageUrl-detail">
deleteButtonImageUrl<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public string <b>$deleteButtonImageUrl</b>;</div>

<p>the image URL for the delete button. If not set, an integrated image will be used.
You may set this property to be false to render a text link instead.</p>


<div class="detailHeader" id="deleteButtonLabel-detail">
deleteButtonLabel<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public string <b>$deleteButtonLabel</b>;</div>

<p>the label for the delete button. Defaults to "Delete".
Note that the label will not be HTML-encoded when rendering.</p>


<div class="detailHeader" id="deleteButtonOptions-detail">
deleteButtonOptions<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public array <b>$deleteButtonOptions</b>;</div>

<p>the HTML options for the view button tag.</p>


<div class="detailHeader" id="deleteButtonUrl-detail">
deleteButtonUrl<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public string <b>$deleteButtonUrl</b>;</div>

<p>a PHP expression that is evaluated for every delete button and whose result is used
as the URL for the delete button. In this expression, the variable
<code>$row</code> the row number (zero-based); <code>$data</code> the data model for the row;
and <code>$this</code> the column object.</p>


<div class="detailHeader" id="deleteConfirmation-detail">
deleteConfirmation<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public string <b>$deleteConfirmation</b>;</div>

<p>the confirmation message to be displayed when delete button is clicked.
By setting this property to be false, no confirmation message will be displayed.
This property is used only if <code>$this->buttons['delete']['click']</code> is not set.</p>


<div class="detailHeader" id="footerHtmlOptions-detail">
footerHtmlOptions<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public array <b>$footerHtmlOptions</b>;</div>

<p>the HTML options for the footer cell tag.</p>


<div class="detailHeader" id="headerHtmlOptions-detail">
headerHtmlOptions<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public array <b>$headerHtmlOptions</b>;</div>

<p>the HTML options for the header cell tag.</p>


<div class="detailHeader" id="htmlOptions-detail">
htmlOptions<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public array <b>$htmlOptions</b>;</div>

<p>the HTML options for the data cell tags.</p>


<div class="detailHeader" id="template-detail">
template<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public string <b>$template</b>;</div>

<p>the template that is used to render the content in each data cell.
These default tokens are recognized: {view}, {update} and {delete}. If the <a href="CButtonColumn.html#buttons">buttons</a> property
defines additional buttons, their IDs are also recognized here. For example, if a button named 'preview'
is declared in <a href="CButtonColumn.html#buttons">buttons</a>, we can use the token '{preview}' here to specify where to display the button.</p>


<div class="detailHeader" id="updateButtonImageUrl-detail">
updateButtonImageUrl<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public string <b>$updateButtonImageUrl</b>;</div>

<p>the image URL for the update button. If not set, an integrated image will be used.
You may set this property to be false to render a text link instead.</p>


<div class="detailHeader" id="updateButtonLabel-detail">
updateButtonLabel<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public string <b>$updateButtonLabel</b>;</div>

<p>the label for the update button. Defaults to "Update".
Note that the label will not be HTML-encoded when rendering.</p>


<div class="detailHeader" id="updateButtonOptions-detail">
updateButtonOptions<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public array <b>$updateButtonOptions</b>;</div>

<p>the HTML options for the update button tag.</p>


<div class="detailHeader" id="updateButtonUrl-detail">
updateButtonUrl<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public string <b>$updateButtonUrl</b>;</div>

<p>a PHP expression that is evaluated for every update button and whose result is used
as the URL for the update button. In this expression, the variable
<code>$row</code> the row number (zero-based); <code>$data</code> the data model for the row;
and <code>$this</code> the column object.</p>


<div class="detailHeader" id="viewButtonImageUrl-detail">
viewButtonImageUrl<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public string <b>$viewButtonImageUrl</b>;</div>

<p>the image URL for the view button. If not set, an integrated image will be used.
You may set this property to be false to render a text link instead.</p>


<div class="detailHeader" id="viewButtonLabel-detail">
viewButtonLabel<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public string <b>$viewButtonLabel</b>;</div>

<p>the label for the view button. Defaults to "View".
Note that the label will not be HTML-encoded when rendering.</p>


<div class="detailHeader" id="viewButtonOptions-detail">
viewButtonOptions<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public array <b>$viewButtonOptions</b>;</div>

<p>the HTML options for the view button tag.</p>


<div class="detailHeader" id="viewButtonUrl-detail">
viewButtonUrl<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public string <b>$viewButtonUrl</b>;</div>

<p>a PHP expression that is evaluated for every view button and whose result is used
as the URL for the view button. In this expression, the variable
<code>$row</code> the row number (zero-based); <code>$data</code> the data model for the row;
and <code>$this</code> the column object.</p>


<h2>Method Details</h2>

<div class="detailHeader" id="init-detail">
init()
<span class="detailHeaderTag">
method
</span>
</div>

<table class="summaryTable">
<tr><td colspan="3">
<div class="signature2">
public void <b>init</b>()</div>
</td></tr>
</table>

<div class="sourceCode">
<b>Source Code:</b> <a class="sourceLink" href="https://github.com/yiisoft/yii/blob/1.1.12/framework/zii/widgets/grid/CButtonColumn.php#L166">framework/zii/widgets/grid/CButtonColumn.php#166</a> (<b><a href="#" class="show">show</a></b>)
<div class="code"><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">public&nbsp;function&nbsp;</span><span style="color: #0000BB">init</span><span style="color: #007700">()<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">initDefaultButtons</span><span style="color: #007700">();<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;foreach(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">buttons&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">$id</span><span style="color: #007700">=&gt;</span><span style="color: #0000BB">$button</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">strpos</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">template</span><span style="color: #007700">,</span><span style="color: #DD0000">'{'</span><span style="color: #007700">.</span><span style="color: #0000BB">$id</span><span style="color: #007700">.</span><span style="color: #DD0000">'}'</span><span style="color: #007700">)===</span><span style="color: #0000BB">false</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unset(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">buttons</span><span style="color: #007700">[</span><span style="color: #0000BB">$id</span><span style="color: #007700">]);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;if(isset(</span><span style="color: #0000BB">$button</span><span style="color: #007700">[</span><span style="color: #DD0000">'click'</span><span style="color: #007700">]))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(!isset(</span><span style="color: #0000BB">$button</span><span style="color: #007700">[</span><span style="color: #DD0000">'options'</span><span style="color: #007700">][</span><span style="color: #DD0000">'class'</span><span style="color: #007700">]))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">buttons</span><span style="color: #007700">[</span><span style="color: #0000BB">$id</span><span style="color: #007700">][</span><span style="color: #DD0000">'options'</span><span style="color: #007700">][</span><span style="color: #DD0000">'class'</span><span style="color: #007700">]=</span><span style="color: #0000BB">$id</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(!(</span><span style="color: #0000BB">$button</span><span style="color: #007700">[</span><span style="color: #DD0000">'click'</span><span style="color: #007700">]&nbsp;instanceof&nbsp;</span><span style="color: #0000BB">CJavaScriptExpression</span><span style="color: #007700">))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">buttons</span><span style="color: #007700">[</span><span style="color: #0000BB">$id</span><span style="color: #007700">][</span><span style="color: #DD0000">'click'</span><span style="color: #007700">]=new&nbsp;</span><span style="color: #0000BB">CJavaScriptExpression</span><span style="color: #007700">(</span><span style="color: #0000BB">$button</span><span style="color: #007700">[</span><span style="color: #DD0000">'click'</span><span style="color: #007700">]);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">registerClientScript</span><span style="color: #007700">();<br />}</span>
</span>
</code></div>
</div>
<p>Initializes the column.
This method registers necessary client script for the button column.</p>


<div class="detailHeader" id="initDefaultButtons-detail">
initDefaultButtons()
<span class="detailHeaderTag">
method
</span>
</div>

<table class="summaryTable">
<tr><td colspan="3">
<div class="signature2">
protected void <b>initDefaultButtons</b>()</div>
</td></tr>
</table>

<div class="sourceCode">
<b>Source Code:</b> <a class="sourceLink" href="https://github.com/yiisoft/yii/blob/1.1.12/framework/zii/widgets/grid/CButtonColumn.php#L189">framework/zii/widgets/grid/CButtonColumn.php#189</a> (<b><a href="#" class="show">show</a></b>)
<div class="code"><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">protected&nbsp;function&nbsp;</span><span style="color: #0000BB">initDefaultButtons</span><span style="color: #007700">()<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">viewButtonLabel</span><span style="color: #007700">===</span><span style="color: #0000BB">null</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">viewButtonLabel</span><span style="color: #007700">=</span><span style="color: #0000BB">Yii</span><span style="color: #007700">::</span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'zii'</span><span style="color: #007700">,</span><span style="color: #DD0000">'View'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">updateButtonLabel</span><span style="color: #007700">===</span><span style="color: #0000BB">null</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">updateButtonLabel</span><span style="color: #007700">=</span><span style="color: #0000BB">Yii</span><span style="color: #007700">::</span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'zii'</span><span style="color: #007700">,</span><span style="color: #DD0000">'Update'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">deleteButtonLabel</span><span style="color: #007700">===</span><span style="color: #0000BB">null</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">deleteButtonLabel</span><span style="color: #007700">=</span><span style="color: #0000BB">Yii</span><span style="color: #007700">::</span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'zii'</span><span style="color: #007700">,</span><span style="color: #DD0000">'Delete'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">viewButtonImageUrl</span><span style="color: #007700">===</span><span style="color: #0000BB">null</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">viewButtonImageUrl</span><span style="color: #007700">=</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">grid</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">baseScriptUrl</span><span style="color: #007700">.</span><span style="color: #DD0000">'/view.png'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">updateButtonImageUrl</span><span style="color: #007700">===</span><span style="color: #0000BB">null</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">updateButtonImageUrl</span><span style="color: #007700">=</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">grid</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">baseScriptUrl</span><span style="color: #007700">.</span><span style="color: #DD0000">'/update.png'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">deleteButtonImageUrl</span><span style="color: #007700">===</span><span style="color: #0000BB">null</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">deleteButtonImageUrl</span><span style="color: #007700">=</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">grid</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">baseScriptUrl</span><span style="color: #007700">.</span><span style="color: #DD0000">'/delete.png'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">deleteConfirmation</span><span style="color: #007700">===</span><span style="color: #0000BB">null</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">deleteConfirmation</span><span style="color: #007700">=</span><span style="color: #0000BB">Yii</span><span style="color: #007700">::</span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'zii'</span><span style="color: #007700">,</span><span style="color: #DD0000">'Are&nbsp;you&nbsp;sure&nbsp;you&nbsp;want&nbsp;to&nbsp;delete&nbsp;this&nbsp;item?'</span><span style="color: #007700">);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;foreach(array(</span><span style="color: #DD0000">'view'</span><span style="color: #007700">,</span><span style="color: #DD0000">'update'</span><span style="color: #007700">,</span><span style="color: #DD0000">'delete'</span><span style="color: #007700">)&nbsp;as&nbsp;</span><span style="color: #0000BB">$id</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$button</span><span style="color: #007700">=array(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'label'</span><span style="color: #007700">=&gt;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;{</span><span style="color: #0000BB">$id</span><span style="color: #007700">.</span><span style="color: #DD0000">'ButtonLabel'</span><span style="color: #007700">},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'url'</span><span style="color: #007700">=&gt;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;{</span><span style="color: #0000BB">$id</span><span style="color: #007700">.</span><span style="color: #DD0000">'ButtonUrl'</span><span style="color: #007700">},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'imageUrl'</span><span style="color: #007700">=&gt;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;{</span><span style="color: #0000BB">$id</span><span style="color: #007700">.</span><span style="color: #DD0000">'ButtonImageUrl'</span><span style="color: #007700">},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'options'</span><span style="color: #007700">=&gt;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;{</span><span style="color: #0000BB">$id</span><span style="color: #007700">.</span><span style="color: #DD0000">'ButtonOptions'</span><span style="color: #007700">},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(isset(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">buttons</span><span style="color: #007700">[</span><span style="color: #0000BB">$id</span><span style="color: #007700">]))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">buttons</span><span style="color: #007700">[</span><span style="color: #0000BB">$id</span><span style="color: #007700">]=</span><span style="color: #0000BB">array_merge</span><span style="color: #007700">(</span><span style="color: #0000BB">$button</span><span style="color: #007700">,</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">buttons</span><span style="color: #007700">[</span><span style="color: #0000BB">$id</span><span style="color: #007700">]);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">buttons</span><span style="color: #007700">[</span><span style="color: #0000BB">$id</span><span style="color: #007700">]=</span><span style="color: #0000BB">$button</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;if(!isset(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">buttons</span><span style="color: #007700">[</span><span style="color: #DD0000">'delete'</span><span style="color: #007700">][</span><span style="color: #DD0000">'click'</span><span style="color: #007700">]))<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">is_string</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">deleteConfirmation</span><span style="color: #007700">))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$confirmation</span><span style="color: #007700">=</span><span style="color: #DD0000">"if(!confirm("</span><span style="color: #007700">.</span><span style="color: #0000BB">CJavaScript</span><span style="color: #007700">::</span><span style="color: #0000BB">encode</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">deleteConfirmation</span><span style="color: #007700">).</span><span style="color: #DD0000">"))&nbsp;return&nbsp;false;"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$confirmation</span><span style="color: #007700">=</span><span style="color: #DD0000">''</span><span style="color: #007700">;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">Yii</span><span style="color: #007700">::</span><span style="color: #0000BB">app</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">request</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">enableCsrfValidation</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$csrfTokenName&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">Yii</span><span style="color: #007700">::</span><span style="color: #0000BB">app</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">request</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">csrfTokenName</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$csrfToken&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">Yii</span><span style="color: #007700">::</span><span style="color: #0000BB">app</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">request</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">csrfToken</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$csrf&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"\n\t\tdata:{&nbsp;'</span><span style="color: #0000BB">$csrfTokenName</span><span style="color: #DD0000">':'</span><span style="color: #0000BB">$csrfToken</span><span style="color: #DD0000">'&nbsp;},"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$csrf&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">''</span><span style="color: #007700">;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">afterDelete</span><span style="color: #007700">===</span><span style="color: #0000BB">null</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">afterDelete</span><span style="color: #007700">=</span><span style="color: #DD0000">'function(){}'</span><span style="color: #007700">;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">buttons</span><span style="color: #007700">[</span><span style="color: #DD0000">'delete'</span><span style="color: #007700">][</span><span style="color: #DD0000">'click'</span><span style="color: #007700">]=&lt;&lt;&lt;EOD<br /></span><span style="color: #DD0000">function()&nbsp;{<br /></span><span style="color: #0000BB">$confirmation</span><span style="color: #DD0000"><br />var&nbsp;th=this;<br />var&nbsp;afterDelete=</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">afterDelete</span><span style="color: #DD0000">;<br />$.fn.yiiGridView.update('</span><span style="color: #007700">{</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">grid</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">id</span><span style="color: #007700">}</span><span style="color: #DD0000">',&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;type:'POST',<br />&nbsp;&nbsp;&nbsp;&nbsp;url:$(this).attr('href'),</span><span style="color: #0000BB">$csrf</span><span style="color: #DD0000"><br />&nbsp;&nbsp;&nbsp;&nbsp;success:function(data)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$.fn.yiiGridView.update('</span><span style="color: #007700">{</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">grid</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">id</span><span style="color: #007700">}</span><span style="color: #DD0000">');<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;afterDelete(th,true,data);<br />&nbsp;&nbsp;&nbsp;&nbsp;},<br />&nbsp;&nbsp;&nbsp;&nbsp;error:function(XHR)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;afterDelete(th,false,XHR);<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />});<br />return&nbsp;false;<br />}<br /></span><span style="color: #007700">EOD;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />}</span>
</span>
</code></div>
</div>
<p>Initializes the default buttons (view, update and delete).</p>


<div class="detailHeader" id="registerClientScript-detail">
registerClientScript()
<span class="detailHeaderTag">
method
</span>
</div>

<table class="summaryTable">
<tr><td colspan="3">
<div class="signature2">
protected void <b>registerClientScript</b>()</div>
</td></tr>
</table>

<div class="sourceCode">
<b>Source Code:</b> <a class="sourceLink" href="https://github.com/yiisoft/yii/blob/1.1.12/framework/zii/widgets/grid/CButtonColumn.php#L264">framework/zii/widgets/grid/CButtonColumn.php#264</a> (<b><a href="#" class="show">show</a></b>)
<div class="code"><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">protected&nbsp;function&nbsp;</span><span style="color: #0000BB">registerClientScript</span><span style="color: #007700">()<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$js</span><span style="color: #007700">=array();<br />&nbsp;&nbsp;&nbsp;&nbsp;foreach(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">buttons&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">$id</span><span style="color: #007700">=&gt;</span><span style="color: #0000BB">$button</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(isset(</span><span style="color: #0000BB">$button</span><span style="color: #007700">[</span><span style="color: #DD0000">'click'</span><span style="color: #007700">]))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$function</span><span style="color: #007700">=</span><span style="color: #0000BB">CJavaScript</span><span style="color: #007700">::</span><span style="color: #0000BB">encode</span><span style="color: #007700">(</span><span style="color: #0000BB">$button</span><span style="color: #007700">[</span><span style="color: #DD0000">'click'</span><span style="color: #007700">]);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$class</span><span style="color: #007700">=</span><span style="color: #0000BB">preg_replace</span><span style="color: #007700">(</span><span style="color: #DD0000">'/\s+/'</span><span style="color: #007700">,</span><span style="color: #DD0000">'.'</span><span style="color: #007700">,</span><span style="color: #0000BB">$button</span><span style="color: #007700">[</span><span style="color: #DD0000">'options'</span><span style="color: #007700">][</span><span style="color: #DD0000">'class'</span><span style="color: #007700">]);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$js</span><span style="color: #007700">[]=</span><span style="color: #DD0000">"$(document).on('click','#</span><span style="color: #007700">{</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">grid</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">id</span><span style="color: #007700">}</span><span style="color: #DD0000">&nbsp;a.</span><span style="color: #007700">{</span><span style="color: #0000BB">$class</span><span style="color: #007700">}</span><span style="color: #DD0000">',</span><span style="color: #0000BB">$function</span><span style="color: #DD0000">);"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$js</span><span style="color: #007700">!==array())<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">Yii</span><span style="color: #007700">::</span><span style="color: #0000BB">app</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">getClientScript</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">registerScript</span><span style="color: #007700">(</span><span style="color: #0000BB">__CLASS__</span><span style="color: #007700">.</span><span style="color: #DD0000">'#'</span><span style="color: #007700">.</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">id</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">implode</span><span style="color: #007700">(</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">,</span><span style="color: #0000BB">$js</span><span style="color: #007700">));<br />}</span>
</span>
</code></div>
</div>
<p>Registers the client scripts for the button column.</p>


<div class="detailHeader" id="renderButton-detail">
renderButton()
<span class="detailHeaderTag">
method
</span>
</div>

<table class="summaryTable">
<tr><td colspan="3">
<div class="signature2">
protected void <b>renderButton</b>(string $id, array $button, integer $row, mixed $data)</div>
</td></tr>
<tr>
  <td class="paramNameCol">$id</td>
  <td class="paramTypeCol">string</td>
  <td class="paramDescCol">the ID of the button</td>
</tr>
<tr>
  <td class="paramNameCol">$button</td>
  <td class="paramTypeCol">array</td>
  <td class="paramDescCol">the button configuration which may contain 'label', 'url', 'imageUrl' and 'options' elements.
See <a href="CButtonColumn.html#buttons">buttons</a> for more details.</td>
</tr>
<tr>
  <td class="paramNameCol">$row</td>
  <td class="paramTypeCol">integer</td>
  <td class="paramDescCol">the row number (zero-based)</td>
</tr>
<tr>
  <td class="paramNameCol">$data</td>
  <td class="paramTypeCol">mixed</td>
  <td class="paramDescCol">the data object associated with the row</td>
</tr>
</table>

<div class="sourceCode">
<b>Source Code:</b> <a class="sourceLink" href="https://github.com/yiisoft/yii/blob/1.1.12/framework/zii/widgets/grid/CButtonColumn.php#L309">framework/zii/widgets/grid/CButtonColumn.php#309</a> (<b><a href="#" class="show">show</a></b>)
<div class="code"><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">protected&nbsp;function&nbsp;</span><span style="color: #0000BB">renderButton</span><span style="color: #007700">(</span><span style="color: #0000BB">$id</span><span style="color: #007700">,</span><span style="color: #0000BB">$button</span><span style="color: #007700">,</span><span style="color: #0000BB">$row</span><span style="color: #007700">,</span><span style="color: #0000BB">$data</span><span style="color: #007700">)<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(isset(</span><span style="color: #0000BB">$button</span><span style="color: #007700">[</span><span style="color: #DD0000">'visible'</span><span style="color: #007700">])&nbsp;&amp;&amp;&nbsp;!</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">evaluateExpression</span><span style="color: #007700">(</span><span style="color: #0000BB">$button</span><span style="color: #007700">[</span><span style="color: #DD0000">'visible'</span><span style="color: #007700">],array(</span><span style="color: #DD0000">'row'</span><span style="color: #007700">=&gt;</span><span style="color: #0000BB">$row</span><span style="color: #007700">,</span><span style="color: #DD0000">'data'</span><span style="color: #007700">=&gt;</span><span style="color: #0000BB">$data</span><span style="color: #007700">)))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$label</span><span style="color: #007700">=isset(</span><span style="color: #0000BB">$button</span><span style="color: #007700">[</span><span style="color: #DD0000">'label'</span><span style="color: #007700">])&nbsp;?&nbsp;</span><span style="color: #0000BB">$button</span><span style="color: #007700">[</span><span style="color: #DD0000">'label'</span><span style="color: #007700">]&nbsp;:&nbsp;</span><span style="color: #0000BB">$id</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$url</span><span style="color: #007700">=isset(</span><span style="color: #0000BB">$button</span><span style="color: #007700">[</span><span style="color: #DD0000">'url'</span><span style="color: #007700">])&nbsp;?&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">evaluateExpression</span><span style="color: #007700">(</span><span style="color: #0000BB">$button</span><span style="color: #007700">[</span><span style="color: #DD0000">'url'</span><span style="color: #007700">],array(</span><span style="color: #DD0000">'data'</span><span style="color: #007700">=&gt;</span><span style="color: #0000BB">$data</span><span style="color: #007700">,</span><span style="color: #DD0000">'row'</span><span style="color: #007700">=&gt;</span><span style="color: #0000BB">$row</span><span style="color: #007700">))&nbsp;:&nbsp;</span><span style="color: #DD0000">'#'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$options</span><span style="color: #007700">=isset(</span><span style="color: #0000BB">$button</span><span style="color: #007700">[</span><span style="color: #DD0000">'options'</span><span style="color: #007700">])&nbsp;?&nbsp;</span><span style="color: #0000BB">$button</span><span style="color: #007700">[</span><span style="color: #DD0000">'options'</span><span style="color: #007700">]&nbsp;:&nbsp;array();<br />&nbsp;&nbsp;&nbsp;&nbsp;if(!isset(</span><span style="color: #0000BB">$options</span><span style="color: #007700">[</span><span style="color: #DD0000">'title'</span><span style="color: #007700">]))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$options</span><span style="color: #007700">[</span><span style="color: #DD0000">'title'</span><span style="color: #007700">]=</span><span style="color: #0000BB">$label</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;if(isset(</span><span style="color: #0000BB">$button</span><span style="color: #007700">[</span><span style="color: #DD0000">'imageUrl'</span><span style="color: #007700">])&nbsp;&amp;&amp;&nbsp;</span><span style="color: #0000BB">is_string</span><span style="color: #007700">(</span><span style="color: #0000BB">$button</span><span style="color: #007700">[</span><span style="color: #DD0000">'imageUrl'</span><span style="color: #007700">]))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #0000BB">CHtml</span><span style="color: #007700">::</span><span style="color: #0000BB">link</span><span style="color: #007700">(</span><span style="color: #0000BB">CHtml</span><span style="color: #007700">::</span><span style="color: #0000BB">image</span><span style="color: #007700">(</span><span style="color: #0000BB">$button</span><span style="color: #007700">[</span><span style="color: #DD0000">'imageUrl'</span><span style="color: #007700">],</span><span style="color: #0000BB">$label</span><span style="color: #007700">),</span><span style="color: #0000BB">$url</span><span style="color: #007700">,</span><span style="color: #0000BB">$options</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #0000BB">CHtml</span><span style="color: #007700">::</span><span style="color: #0000BB">link</span><span style="color: #007700">(</span><span style="color: #0000BB">$label</span><span style="color: #007700">,</span><span style="color: #0000BB">$url</span><span style="color: #007700">,</span><span style="color: #0000BB">$options</span><span style="color: #007700">);<br />}</span>
</span>
</code></div>
</div>
<p>Renders a link button.</p>


<div class="detailHeader" id="renderDataCellContent-detail">
renderDataCellContent()
<span class="detailHeaderTag">
method
</span>
</div>

<table class="summaryTable">
<tr><td colspan="3">
<div class="signature2">
protected void <b>renderDataCellContent</b>(integer $row, mixed $data)</div>
</td></tr>
<tr>
  <td class="paramNameCol">$row</td>
  <td class="paramTypeCol">integer</td>
  <td class="paramDescCol">the row number (zero-based)</td>
</tr>
<tr>
  <td class="paramNameCol">$data</td>
  <td class="paramTypeCol">mixed</td>
  <td class="paramDescCol">the data associated with the row</td>
</tr>
</table>

<div class="sourceCode">
<b>Source Code:</b> <a class="sourceLink" href="https://github.com/yiisoft/yii/blob/1.1.12/framework/zii/widgets/grid/CButtonColumn.php#L287">framework/zii/widgets/grid/CButtonColumn.php#287</a> (<b><a href="#" class="show">show</a></b>)
<div class="code"><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">protected&nbsp;function&nbsp;</span><span style="color: #0000BB">renderDataCellContent</span><span style="color: #007700">(</span><span style="color: #0000BB">$row</span><span style="color: #007700">,</span><span style="color: #0000BB">$data</span><span style="color: #007700">)<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$tr</span><span style="color: #007700">=array();<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">ob_start</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;foreach(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">buttons&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">$id</span><span style="color: #007700">=&gt;</span><span style="color: #0000BB">$button</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">renderButton</span><span style="color: #007700">(</span><span style="color: #0000BB">$id</span><span style="color: #007700">,</span><span style="color: #0000BB">$button</span><span style="color: #007700">,</span><span style="color: #0000BB">$row</span><span style="color: #007700">,</span><span style="color: #0000BB">$data</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$tr</span><span style="color: #007700">[</span><span style="color: #DD0000">'{'</span><span style="color: #007700">.</span><span style="color: #0000BB">$id</span><span style="color: #007700">.</span><span style="color: #DD0000">'}'</span><span style="color: #007700">]=</span><span style="color: #0000BB">ob_get_contents</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">ob_clean</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">ob_end_clean</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #0000BB">strtr</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">template</span><span style="color: #007700">,</span><span style="color: #0000BB">$tr</span><span style="color: #007700">);<br />}</span>
</span>
</code></div>
</div>
<p>Renders the data cell content.
This method renders the view, update and delete buttons in the data cell.</p>


</div><!-- end of content -->

<div id="apiFooter">
Copyright &copy; 2008-2011 by <a href="http://www.yiisoft.com">Yii Software LLC</a><br/>
All Rights Reserved.<br/>
</div><!-- end of footer -->

<script type="text/javascript">
/*<![CDATA[*/
$("a.toggle").toggle(function(){
	$(this).text($(this).text().replace(/Hide/,'Show'));
	$(this).parents(".summary").find(".inherited").hide();
},function(){
	$(this).text($(this).text().replace(/Show/,'Hide'));
	$(this).parents(".summary").find(".inherited").show();
});
$(".sourceCode a.show").toggle(function(){
	$(this).text($(this).text().replace(/show/,'hide'));
	$(this).parents(".sourceCode").find("div.code").show();
},function(){
	$(this).text($(this).text().replace(/hide/,'show'));
	$(this).parents(".sourceCode").find("div.code").hide();
});
$("a.sourceLink").click(function(){
	$(this).attr('target','_blank');
});
/*]]>*/
</script>

</div><!-- end of page -->
</body>
</html>